package com.feicheng.iou.openMessage.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:wechatInformationPushConfig.properties",encoding = "UTF-8")
public class WechatSendMessageConfig implements InitializingBean {

    @Value("${GetAccessTokenGateway}")
    private String getAccessTokenGateway;


    @Value("${SendMessageGateway}")
    private String sendMessageGateWay;

    @Value("${appsecret}")
    private String appsecret;


    @Value("${appid}")
    private String appid;

    @Value("${templateId}")
    private String templateId;

    @Value("${url}")
    private String url;

    public static String GET_ACCESSTOKEN_GATEWAY;
    public static String SEND_MESSAGE_GATEWAY;
    public static String APPSECRET;
    public static String APPID;
    public static String TEMPLATE_ID;
    public static String URL;

    @Override
    public void afterPropertiesSet() throws Exception {
        GET_ACCESSTOKEN_GATEWAY = getAccessTokenGateway;
        SEND_MESSAGE_GATEWAY = sendMessageGateWay;
        APPSECRET = appsecret;
        APPID = appid;
        TEMPLATE_ID = templateId;
        URL = url;
    }
}
